/*
 * diskio.c
 *
 * Created: 2011.10.26 17:10:12
 *  Author: Administrator
 */ 

#include "diskio.h"

#include "../driver/sdc.h"

int assign_drives (int src, int dest)
{
	
}
DSTATUS disk_initialize (BYTE drive)
{
	return SDC_init();
}
DSTATUS disk_status (BYTE drive)
{
	return 0;
}
DRESULT disk_read (BYTE drive, BYTE *buff, DWORD sectorNumber, BYTE sectorCount)
{
	return SDC_readblock(sectorNumber,buff,0);
}
#if	_READONLY == 0
DRESULT disk_write (BYTE drive, const BYTE *buff, DWORD sectorNumber, BYTE sectorCount)
{
	DSTATUS ds;
	int i;
	for (i=0;i<sectorCount;i++)
	{
		SDC_writeblock(sectorNumber+i,&(buff[i*512]),0);
	}
	return 0;
}
#endif
DRESULT disk_ioctl (BYTE drive, BYTE command, void *buffer)
{
	return 0;
}

DWORD get_fattime (void)
{
	return 0;
}